package com.lanou.web;

import com.lanou.domain.CrmPost;
import com.lanou.service.PostServiceImpl;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 职务post层
 */
public class PostAction {

    //创建service层对象
    @Resource(name = "postService")
    PostServiceImpl postService;
    //获取depId
    String depId;

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    //    创建一个对象，存储返回的结果对象
    List<CrmPost> allPost=new ArrayList<CrmPost>();
    CrmPost post;


    //通过部分查询所有的职务(ajax)
    public String findPostWithDepartment(){
        System.out.println("根据id查询职务信息.......");
        allPost=postService.findPost(depId);
        System.out.println(allPost);
        return "SUCCESS";
    }

    public PostServiceImpl getPostService() {
        return postService;
    }

    public void setPostService(PostServiceImpl postService) {
        this.postService = postService;
    }

    public List<CrmPost> getAllPost() {
        return allPost;
    }

    public void setAllPost(List<CrmPost> allPost) {
        this.allPost = allPost;
    }

    public CrmPost getPost() {
        return post;
    }

    public void setPost(CrmPost post) {
        this.post = post;
    }
}
